package tasks;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class UserActionListener implements ActionListener {
    public static final String ADD_PROCESSOR = "Add processor";
    public static final String ADD_RAM = "Add ram";
    public static final String ADD_GPU = "Add gpu";
    public static final String ADD_COMPUTER = "Add computer";
    
    public UserActionListener() {
        super();
    }

    public void actionPerformed(ActionEvent e) {
        String command = e.getActionCommand();
        if(command.equals(ADD_COMPUTER)) {
            UserInterface.addComputerCfg();
        } else if(command.equals(ADD_PROCESSOR)) {
            UserInterface.addComponent(0);
        } else if(command.equals(ADD_RAM)) {
            UserInterface.addComponent(1);
        } else if(command.equals(ADD_GPU)) {
            UserInterface.addComponent(2);
        }
    }
}
